package com.ssc.shalomsoft;

import org.eclipse.core.runtime.preferences.ConfigurationScope;
import org.osgi.service.prefs.BackingStoreException;
import org.osgi.service.prefs.Preferences;

class PreferenceManager {
	private PreferenceManager() {
	}

	public static PreferenceManager INSTANCE = new PreferenceManager();
	Preferences preferences = ConfigurationScope.INSTANCE.getNode("com.blonvia.rsg.shalom");

	public void save(String prefNode, String keyPath, String value) {
		Preferences sub1 = preferences.node(prefNode);

		sub1.put(keyPath, value);

		try {
			// Forces the application to save the preferences
			preferences.flush();
		} catch (BackingStoreException e2) {
			e2.printStackTrace();
		}
	}
	public String read(String prefNode, String keyPath) {
		String result =null;
		Preferences sub1 = preferences.node(prefNode);
		
		result=sub1.get(keyPath, "");
		
		
		return result;
	}
}